#define GTK_TREE_VIEW_PRIORITY_VALIDATE (GDK_PRIORITY_REDRAW + 5)
#define GTK_TREE_VIEW_PRIORITY_SCROLL_SYNC (GTK_TREE_VIEW_PRIORITY_VALIDATE + 2)
-#define GTK_TREE_VIEW_NUM_ROWS_PER_IDLE 500
+#define GTK_TREE_VIEW_TIME_MS_PER_IDLE 30
#define SCROLL_EDGE_SIZE 15
#define EXPANDER_EXTRA_PADDING 4
#define GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT 5000
GtkTreeView *tree_view = GTK_TREE_VIEW (widget);
GList *tmp_list;
- /* we validate GTK_TREE_VIEW_NUM_ROWS_PER_IDLE rows initially just to make
- * sure we have some size. In practice, with a lot of static lists, this
- * should get a good width.
+ /* we validate some rows initially just to make sure we have some size.
+ * In practice, with a lot of static lists, this should get a good width.
*/
do_validate_rows (tree_view, FALSE);
gtk_tree_view_size_request_columns (tree_view);
gint retval = TRUE;
GtkTreePath *path = NULL;
GtkTreeIter iter;
+ GTimer *timer;
gint i = 0;
gint prev_height = -1;
return FALSE;
}
+ timer = g_timer_new ();
+ g_timer_start (timer);
+
do
{
if (! GTK_RBNODE_FLAG_SET (tree_view->priv->tree->root, GTK_RBNODE_DESCENDANTS_INVALID))
i++;
}
- while (i < GTK_TREE_VIEW_NUM_ROWS_PER_IDLE);
+ while (g_timer_elapsed (timer, NULL) < GTK_TREE_VIEW_TIME_MS_PER_IDLE / 1000.);
if (!tree_view->priv->fixed_height_check)
{
}
if (path) gtk_tree_path_free (path);
+ g_timer_destroy (timer);
return retval;
}